@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="deviceInfoForm">
            <input type="hidden" id="id"  value="${item.id}" />
            <input type="hidden" id="deviceValue"  value="${item.device}" />
            <input type="hidden" id="statusValue"  value="${item.status}" />
            <input type="hidden" id="weekValue"  value="${item.week}" />
            <div class="row">
                <div class="col-sm-6 b-r">
                            <!--<#input id="id" name="id" value="${item.id}" underline="true"/>-->
                            <#input id="name" name="名称" value="${item.name}" underline="true"/>
                            <!--<#input id="device" name="所属门禁" value="${item.device}" underline="true"/>-->
                    <#select id="device" name="所属门禁" underline="true">
                    </#select>
                            <!--<#input id="status" name="状态" value="${item.status}" />-->
                    <#select id="status" name="状态" underline="true">
                        <option value=1>允许通过</option>
                        <option value=0>禁止通过</option>
                    </#select>
                </div>

                <div class="col-sm-6">
                            <!--<#input id="week" name="星期" value="${item.week}" underline="true"/>-->
                    <#select id="week" name="星期" underline="true">
                        <option value=1>星期一</option>
                        <option value=2>星期二</option>
                        <option value=3>星期三</option>
                        <option value=4>星期四</option>
                        <option value=5>星期五</option>
                        <option value=6>星期六</option>
                        <option value=7>星期日</option>
                    </#select>
                            <#input id="begin" name="起始时间" value="${item.begin}" underline="true"/>
                            <#input id="end" name="结束时间" value="${item.end}" />
                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="DeviceTimeInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="DeviceTimeInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/devicetime/deviceTime/deviceTime_info.js"></script>
<script>
    laydate.render({
        elem: '#begin',
        type: 'time'
    });
    laydate.render({
        elem: '#end',
        type: 'time'
    });
</script>
<script>
    var objSelectNow=document.getElementById("device");

    $.ajax({
        type:'post',
        url:'/deviceTime/status',
        dataType:'json',
        success:function(data){
            for (var i=0;i<data.length;i++)
            {
                objSelectNow.options.add(new Option(data[i].name,data[i].name));
            }
        }
    });



</script>

@}
